set the member of sprite (the spriteNum of me) = member the downCM of me
set the button_active of me = TRUE
end
on mouseUp me
set the member of sprite (the spriteNum of me) = member the UpCM of me
set the button_active of me = false
end
on mouseEnter me
if the button_active of me then
set the member of sprite (the spriteNum of me) = member the DownCM of me
end if
end
on mouseLeave me
if the button_active of me then
set the member of sprite (the spriteNum of me) = member the UpCM of me
end if
end
on mouseUpOutside me
-- mouse leave will set the picture to up
set the button_active of me = false
end
---
on beginSprite me
set the UpCM of me = the member of sprite (the spriteNum of me)
set the UpNum of me = the number of member UpCM
set the DownNum of me = the number of member DownCM
set the button_active of me = false
-- puppetSprite the spriteNum of me, TRUE
end
on endSprite me
-- puppetSprite the spriteNum of me, FALSE
end
on getPropertyDescriptionList
if the currentspritenum = 0 then
set memdefault = 0
else
set memref = the member of sprite the currentspritenum
set castlibnum = the castlibnum of memref
set memdefault = member (the membernum of member memref + 1) of castlib castlibnum
end if
set p_list = [ ¼
#DownCM: [ #comment: "Hilite Image:", ¼
#format: #graphic, ¼
#default: memdefault ] ¼
]
return p_list
end
on getBehaviorDescription
return ¼
"Makes a sprite work as a pushbutton with automatic highlighting and mouse tracking. The sprite's initial castmember represents the button's normal state." & RETURN & ¼
"PARAMETERS:" & RETURN & ¼
"ò Hilite Image - Choose the cast member to display when the button is pressed. The default value is the cast member immedietly following the sprite's current cast member."